<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>组件数据存放问题</title>
    <script src="js/vue.min.js"></script>
</head>
<body>
<div id="app">
    <cpn1></cpn1>
</div>
</body>
<script>
    const app = new Vue({
        el:"#app",
        components:{
            cpn1:{
                template:'<div>{{msg}}</div>',
                data(){
                    return {
                        msg:"组件的数据存放必须是一个函数"
                    }
                }
            }
        }
    })
</script>
</html>